﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace Prototype
{
    /// <summary>
    /// Base abstract class
    /// </summary>
    public abstract class Prototype
    {
        public int Value { get; set; }

        public abstract Prototype Clone();
    }

    public class MyClass: Prototype
    {
        /// <summary>
        /// Long time initialization constructor
        /// </summary>
        public MyClass()
        {
            Thread.Sleep(3000);
        }

        /// <summary>
        /// Method for create new object without construction call. All data will been copied to new object.
        /// </summary>
        /// <returns></returns>
        public override Prototype Clone()
        {
            return (Prototype) this.MemberwiseClone();
        }
    }
}
